﻿using System;
using System.Web.UI;

namespace Rob.SampleCode.MyApp.Webforms
{
    public partial class Error : Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (IsPostBack) return;

            lnkHome.Text = lnkHome.NavigateUrl = new Uri(Request.Url, ResolveUrl("~/")).AbsoluteUri;

            var unhandledException = Session["UnhandledException"] as Exception;
            if (unhandledException == null)
                return;

            preErrorDetails.InnerText = unhandledException.ToString();
        }
    }
}